home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
misc
/
emu
/
ATUtilities.lha
/
ATUtilities
/
BASIC
/
PREFS.BAS
< prev
next >
Wrap
BASIC Source File
|
2000-09-26
|
9KB
|
447 lines
$STRING 1
$INCLUDE "GEMDOS.INC"
dim red(15),green(15),blue(15)
dim ored(15),ogreen(15),oblue(15)
mode=0
if command$="farben "+GemDOS$ then
mode=1
elseif command$="maus "+GemDOS$ then
mode=2
elseif command$="verzeichnisse "+GemDOS$ then
mode=3
elseif command$="signalton "+GemDOS$ then
mode=4
end if
if mode=0 then
mode=1
call InitScreen(35,"Einstellungen")
else
select case mode
case 1
t$="Farben ndern"
case 2
t$="Mausparameter ndern"
case 3
t$="Verzeichnisse einstellen"
case 4
t$="Signalton"
end select
call PrepareScreen(35,t$)
end if
call BoolGadget(5,26,25,1,"Zurck zu AControl",1)
call MenuGadget(6,"Datei",10000)
Feld1$(0)="Einstellungen laden"
Feld1$(1)="Einstellungen sichern"
Feld1$(2)="-"
Feld1$(3)="nderungen zurcknehmen"
Feld1$(4)="-"
Feld1$(5)="Information"
Feld1$(6)="-"
Feld1$(7)="Zurck zu AControl"
if mode=1 then
for i=0 to 7
call DrawPBorder(5,6+(i*2),20,1,"")
call MinGadget(5,6+(i*2),20,1,100+i)
line (5*8-1,(6+(i*2))*16-3)-(25*8-3,(7+(i*2))*16-1),i,bf
next
for i=0 to 7
call DrawPBorder(55,6+(i*2),20,1,"")
call MinGadget(55,6+(i*2),20,1,108+i)
line (55*8-1,(6+(i*2))*16-3)-(75*8-3,(7+(i*2))*16-1),8+i,bf
next
call DrawNBorder(5,6,20,1,"")
col=0
call BoolGadget(28,6,5,1,"-",200)
call BoolGadget(28,8,5,1,"<",2000)
call BoolGadget(47,6,5,1,"+",201)
call BoolGadget(47,8,5,1,">",2001)
call BoolGadget(28,12,5,1,"-",202)
call BoolGadget(28,14,5,1,"<",2002)
call BoolGadget(47,12,5,1,"+",203)
call BoolGadget(47,14,5,1,">",2003)
call BoolGadget(28,18,5,1,"-",204)
call BoolGadget(28,20,5,1,"<",2004)
call BoolGadget(47,18,5,1,"+",205)
call BoolGadget(47,20,5,1,">",2005)
call BoolGadget(28,22,24,1,"Reset",206)
for i=0 to 15
reg %ax,&H10*256+&H15
reg %bx,i
call interrupt &H10
green(i)=int(reg(%cx) / 256)
blue(i)=int(reg(%cx) mod 256)
red(i)=int(reg(%dx) / 256)
ogreen(i)=green(i)
oblue(i)=blue(i)
ored(i)=red(i)
next
call FarbenAusgabe
elseif mode=2 then
locate 12,5
print "Horizontale Sensitivitt"
locate 14,5
print "Vertikale Sensitivitt"
locate 18,5
print "Beschleunigung"
call BoolGadget(30,11,5,1,"-",11)
call BoolGadget(36,11,5,1,"+",12)
call BoolGadget(30,13,5,1,"-",13)
call BoolGadget(36,13,5,1,"+",14)
call BoolGadget(30,17,5,1,"-",15)
call BoolGadget(36,17,5,1,"+",16)
call BoolGadget(30,20,11,1,"Reset",17)
reg %AX,&H1B
call interrupt &H33
mouse.h=REG(%BX)
mouse.v=REG(%CX)
mouse.s=REG(%DX)
call MausAusgabe
elseif mode=3 then
call StrGadget(10,10,40,1,"Test 1234567890 abcdefghijklmn",37,1000)
elseif mode=4 then
Feld1$(3)=Feld1$(3)+chr$(0)
color 15
locate 13,12
print "Signalton"
signalton=1
call STLaden
call ToggleGadget(30,12,20,1,"Einschalten",signalton,4700)
end if
call MouseOn
ende=0
while ende=0
call MouseDown
if mouse.button<>0 then call MouseHandler
select case gad.num
case 1
ende=1
case 33333
ende=1
case 10000
call MenuHandler(6,250,Feld1$(),8)
select case menu.num
case 0
select case mode
case 1
call FarbenLaden
case 2
call MausLaden
case 4
call STLaden
call RemoveGadget(4700)
call ToggleGadget(30,12,20,1,"Einschalten",signalton,4700)
end select
case 1
select case mode
case 1
call FarbenSichern
case 2
call MausSichern
case 4
call STSichern
end select
case 3
select case mode
case 1
call FarbenReset
case 2
call MausReset
end select
case 5
call InformationBox("Einstellungen - Version 1.0","Copyright (C) 1994 by","Thomas Dreibholz","All rights reserved.")
case 7
ende=1
end select
case 11
if mouse.h>20 then
mouse.h=mouse.h-5
call Set
end if
case 12
mouse.h=mouse.h+5
call Set
case 13
if mouse.v>20 then
mouse.v=mouse.v-5
call Set
end if
case 14
mouse.v=mouse.v+5
call Set
case 15
if mouse.s>=25 then
mouse.s=mouse.s-25
call Set
else
mouse.s=0
call Set
end if
case 16
mouse.s=mouse.s+25
call Set
case 17
call MausReset
case 200
if red(col)>0 then
red(col)=red(col)-1
call Farbe
end if
case 201
if red(col)<63 then
red(col)=red(col)+1
call Farbe
end if
case 2000
if red(col)>16 then
red(col)=red(col)-16
else
red(col)=0
end if
call Farbe
case 2001
if red(col)<47 then
red(col)=red(col)+16
else
red(col)=63
end if
call Farbe
case 2002
if green(col)>16 then
green(col)=green(col)-16
else
green(col)=0
end if
call Farbe
case 2003
if green(col)<47 then
green(col)=green(col)+16
else
green(col)=63
end if
call Farbe
case 2004
if blue(col)>16 then
blue(col)=blue(col)-16
else
blue(col)=0
end if
call Farbe
case 2005
if blue(col)<47 then
blue(col)=blue(col)+16
else
blue(col)=63
end if
call Farbe
case 202
if green(col)>0 then
green(col)=green(col)-1
call Farbe
end if
case 203
if green(col)<63 then
green(col)=green(col)+1
call Farbe
end if
case 204
if blue(col)>0 then
blue(col)=blue(col)-1
call Farbe
end if
case 205
if blue(col)<63 then
blue(col)=blue(col)+1
call Farbe
end if
case 206
call FarbenReset
case 4700
if gad.selected(gad.id)=0 then
signalton=0
sound 1000,2
else
signalton=1
end if
case else
if gad.num>=100 and gad.num<=115 then
call MouseOff
if col<8 then
call DrawPBorder(5,6+(col*2),20,1,"")
else
call DrawPBorder(55,6+((col-8)*2),20,1,"")
end if
col=gad.num-100
if col<8 then
call DrawNBorder(5,6+(col*2),20,1,"")
else
call DrawNBorder(55,6+((col-8)*2),20,1,"")
end if
call FarbenAusgabe
call MouseOn
end if
end select
gad.num=-1
wend
call MouseOff
end
sub Set shared
reg %ax,&H1a
reg %bx,mouse.h
reg %cx,mouse.v
reg %dx,mouse.s
call interrupt &H33
call MouseOff
call MausAusgabe
call MouseOn
end sub
sub MausAusgabe shared
color 15
locate 12,44
print mouse.h;"Mickeys = 8 Pixel "
locate 14,44
print mouse.v;"Mickeys = 8 Pixel "
locate 18,44
print mouse.s;"Mickeys pro Sekunde "
end sub
sub FarbenAusgabe shared
color 15
locate 8,36
print "Rot ";red(col);" "
locate 14,36
print "Grn ";green(col);" "
locate 20,36
print "Blau ";blue(col);" "
end sub
sub Farbe shared
reg %ax,&H10*256+&H10
reg %bx,col
reg %cx,green(col)*256+blue(col)
reg %dx,red(col)*256
call interrupt &H10
call MouseOff
call FarbenAusgabe
call MouseOn
end sub
sub FarbenReset shared
call MouseOff
for i=0 to 15
red(i)=ored(i)
green(i)=ogreen(i)
blue(i)=oblue(i)
reg %ax,&H10*256+&H10
reg %bx,i
reg %cx,green(i)*256+blue(i)
reg %dx,red(i)*256
call interrupt &H10
next
call FarbenAusgabe
call MouseOn
end sub
sub MausReset shared
mouse.s=50
mouse.h=50
mouse.v=50
call Set
end sub
sub FarbenLaden shared
9 error 0
10 open "farben.dat" for input as #1
if erl=10 then
call Bell
exit sub
end if
for i=0 to 15
ored(i)=asc(input$(1,1))
ogreen(i)=asc(input$(1,1))
oblue(i)=asc(input$(1,1))
next
close #1
call FarbenReset
end sub
sub FarbenSichern shared
19 error 0
20 open "farben.dat" for output as #1
if erl=20 then
call Bell
exit sub
end if
for i=0 to 15
print #1,chr$(red(i));chr$(green(i));chr$(blue(i));
next
close #1
end sub
sub MausLaden shared
29 error 0
30 open "maus.dat" for input as #1
if erl=30 then
call Bell
exit sub
end if
mouse.h=cvi(input$(2,1))
mouse.v=cvi(input$(2,1))
mouse.s=cvi(input$(2,1))
close #1
call Set
end sub
sub MausSichern shared
139 error 0
140 open "maus.dat" for output as #1
if erl=140 then
call Bell
exit sub
end if
print #1,mki$(mouse.h);mki$(mouse.v);mki$(mouse.s);
close #1
end sub
sub STLaden shared
129 error 0
130 open "signalton.dat" for input as #1
if erl=130 then
call Bell
exit sub
end if
signalton=asc(input$(1,1))
close #1
end sub
sub STSichern shared
39 error 0
40 open "signalton.dat" for output as #1
if erl=40 then
call Bell
signalton=0
exit sub
end if
print #1,chr$(signalton);
close #1
end sub